package com.class05.config;

import com.class05.jsp.EncodingInterceptor;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


/**
 * @ClassDescription:
 * @JdkVersion: 17
 * @Author: yxy
 * @Created: 2023/12/1 9:28
 */
@Configuration
//@ComponentScan("com.class05.param1")
@ComponentScan("com.class05.api7")

@EnableWebMvc//handlerAdapter配置了json转化器
//添加HandlerMapping 添加了HandlerAdapter
// 给HandlerAdapter添加jacksonjson处理器
public class MvcConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
       registry.addInterceptor(new EncodingInterceptor());
    }
    //    @Bean
//    public RequestMappingHandlerMapping handlerMapping() {
//        return new RequestMappingHandlerMapping();
//    }
//    @Bean
//    public RequestMappingHandlerAdapter handlerAdapter(){
//        return new RequestMappingHandlerAdapter();
//    }

}
